package chp07;

import java.util.Scanner;

public class Test9 {
    public static void main(String[] args) {
        double[] nums = new double[5];
        Scanner input = new Scanner(System.in);
        for (int i = 0; i < nums.length; i++) {
            System.out.print("请输入第"+(i+1)+"笔金额:");
            nums[i] = input.nextDouble();
        }
        System.out.println("\n序号\t金额");
        double sum = 0;
        for (int i = 0; i < nums.length; i++) {
            System.out.println((i+1)+"\t\t"+nums[i]);
            sum += nums[i];
        }
        System.out.println("总金额:\t"+sum);
    }
}
